﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Stack_Model
{
    public class MyStack
    {
        private List<Object> InnerStack;

        public MyStack()
        {
            InnerStack = new List<object>();
        }

        public void Push(object pushObject)
        {
            InnerStack.Add(pushObject);
        }

        public void Clear()
        {
            InnerStack.Clear();
        }

        public string Pop()
        {
            int index = InnerStack.Count - 1;
            if (index < 0)
            {
                return "Попать нечего, пока :)";
            }
            else
            {
                string poped = InnerStack[index].ToString();
                InnerStack.RemoveAt(index);
                return poped;
            }
        }
    }
}
